package n17.second;
import java.io.*;
public class S03 {
	public static void main(String[] args) {
		try(
			InputStream fs = new FileInputStream("D:/out/名言.txt"); //字节输入流
			Reader reader = new InputStreamReader(fs, "utf-8");//字节流转换为字符流，一定有编码
			BufferedReader br = new BufferedReader(reader) //再转换为缓冲流
		){
			int lineNumber=0;
			while(true) {
				String line = br.readLine(); //读一行数据，返回null表示读完
				if(line==null)break; //读完就退出循环
				System.out.printf("%6d  %s\n",++lineNumber, line); //显示一行文本信息
			}
		}catch(Exception e) {
			
		}
	}

}
